import request from '@/utils/request'

// 分页查询
export function pagingTaxItems(query) {
  return request({
    url: '/warehouse/warehouseTaxItems/paging',
    method: 'post',
    params: query
  })
}

// 单个回显
export function getTaxItems(taxItemsId) {
  return request({
    url: '/warehouse/warehouseTaxItems/get',
    method: 'get',
    params: { taxItemsId }
  })
}

// 保存
export function saveTaxItems(data) {
  return request({
    url: '/warehouse/warehouseTaxItems/save',
    method: 'post',
    data: data
  })
}

// 删除
export function deleteTaxItems(warehouseTaxItemsId) {
  return request({
    url: '/warehouse/warehouseTaxItems/delete',
    method: 'post',
    params: { warehouseTaxItemsId }
  })
}

// 批量删除
export function batchDelete(data) {
  return request({
    url: '/warehouse/warehouseTaxItems/batchDelete',
    method: 'post',
    data: data
  })
}

// 批量导入税目
export function importTax(params) {
  return request({
    url: '/warehouse/warehouseTaxItems/saveFromExcel',
    method: 'post',
    params
  })
}

// 通过用户ID查询税目信息
export function getTaxList(enterpriseId) {
  return request({
    url: '/warehouse/warehouseTaxItems/listByEnterpriseId',
    method: 'get',
    params: { enterpriseId }
  })
}
